Repository navigation
Route request_continuation to queue successors, approval issues or workflow dispatch - #80174
Merged
Merged
Conversation
| * @param {any} payload | ||
| * @returns {string} | ||
| */ | ||
| function renderContinuationRequest(payload) { |
| core.info("request_continuation: follow-up requested; continuation not confirmed"); | ||
| return { | ||
| success: true, | ||
| message: message.message, |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical defects can misattribute stale continuation evidence after reruns, expose private task content in logs, and reject completion after resource effects have run.
11 open issues
Redact continuation messages from collector log previews · New Handle graph capacity before accepting continuation requests · New Validate cached audit identity against current run metadata · New Invalidate stale agent evidence before early returns · New Accept .yaml continuation config files · New Exempt continuation bookkeeping from output contract checks · New Allow underscores in managed-user login names · New Rotate refresh coverage across unresolved approval gates · New Remove workflow-prefixed agent artifact markers · New Clear cached audit fields when continuation evidence is invalid · New Preserve approval-gate read access for existing successors · New
What changed in this PR
Extends gh-aw’s advisory continuation signal with opt-in follow-up routing, building on the v4 work-queue ledger from #79748. It also ports the signal and analytics introduced in #79834.
Changes:
- Add bounded routing to queue successors, approval-gated successors, or another local workflow.
- Bind routing evidence to the producing run attempt and extend queue replay and assignments for continuations and approvals.
- Add request analytics, schemas, documentation, tests, and advisory adoption in three workflows.
| File | Description |
|---|---|
specs/work-queue/WorkQueueV4.tla |
Model atomic continuation successors. |
specs/work-queue/README.md |
Document successor-bearing finish commits. |
schemas/logs.schema.json |
Add continuation reports and totals. |
schemas/logs-jsonl.schema.json |
Add continuation fields to JSONL reports. |
schemas/audit.schema.json |
Add audit continuation evidence fields. |
pkg/workqueue/types.go |
Define continuation and approver data. |
pkg/workqueue/selection.go |
Include continuation context in assignments. |
pkg/workqueue/request.go |
Permit successor Work in finish requests. |
pkg/workqueue/replay.go |
Validate successors and approval evidence. |
pkg/workqueue/lifecycle.go |
Require approval before claiming gated Work. |
pkg/workflow/work_queue_repo_config.go |
Detect dispatcher approval-read needs. |
pkg/workflow/work_queue_memory.go |
Reserve the continuation tool name. |
pkg/workflow/unified_prompt_step.go |
Include continuation tools and route guidance. |
pkg/workflow/safe_outputs_validation_config.go |
Register continuation message validation. |
pkg/workflow/safe_outputs_tools.go |
Classify continuation as an internal tool. |
pkg/workflow/safe_outputs_tools_computation.go |
Include enabled continuation tools. |
pkg/workflow/safe_outputs_state.go |
Recognize routed continuation processing. |
pkg/workflow/safe_outputs_permissions.go |
Add routing and approval-read permissions. |
pkg/workflow/safe_outputs_max_validation.go |
Validate bounded request limits. |
pkg/workflow/safe_outputs_max_validation_test.go |
Cover continuation limit rules. |
pkg/workflow/safe_outputs_handler_registry_test.go |
Verify continuation handler registration. |
pkg/workflow/safe_outputs_handler_registry_diagnostics.go |
Generate trusted route descriptors. |
pkg/workflow/safe_outputs_config_types.go |
Add continuation configuration fields. |
pkg/workflow/safe_outputs_config_generation.go |
Strip trusted routing details from agent configuration. |
pkg/workflow/safe_outputs_config_extraction.go |
Parse continuation configuration. |
pkg/workflow/safe_outputs_authorization.go |
Classify routing and admission authorization. |
pkg/workflow/safe_output_handlers.go |
Register the continuation safe output. |
pkg/workflow/request_continuation_test.go |
Test advisory configuration and compilation. |
pkg/workflow/prompt_constants.go |
Name route-specific prompt fragments. |
pkg/workflow/notify_comment.go |
Add conclusion request recording. |
pkg/workflow/notify_comment_conclusion_helpers.go |
Generate the request-recording step. |
pkg/workflow/js/safe_outputs_tools.json |
Define the embedded continuation tool. |
pkg/workflow/compiler.go |
Invoke continuation route validation. |
pkg/workflow/compiler_yaml_post_agent.go |
Bind evidence before artifact uploads. |
pkg/workflow/compiler_validators.go |
Validate continuation authorization settings. |
pkg/workflow/compiler_safe_outputs_steps.go |
Pass routing evidence to trusted processing. |
pkg/workflow/compiler_safe_outputs_job.go |
Configure routed processing and queue finalization. |
pkg/workflow/compiler_main_job_helpers.go |
Expose continuation evidence as a job output. |
pkg/workflow/authorization_inventory.go |
Report queue admission authorization. |
pkg/parser/schemas/main_workflow_schema.json |
Define continuation configuration and constraints. |
pkg/parser/schema_request_continuation_test.go |
Test advisory and routed schema rules. |
pkg/cli/outcome_eval.go |
Exclude request intent from adoption evaluation. |
pkg/cli/outcome_eval_test.go |
Test request exclusion from outcomes. |
pkg/cli/mcp_tools_privileged.go |
Describe continuation evidence in logs responses. |
pkg/cli/mcp_tools_health.go |
Describe cached continuation health metrics. |
pkg/cli/logs_run_summary.go |
Persist requests in run summaries. |
pkg/cli/logs_run_cache.go |
Validate and backfill cached request evidence. |
pkg/cli/logs_run_cache_test.go |
Test prior-attempt artifact invalidation. |
pkg/cli/logs_run_analysis.go |
Extract continuation requests during analysis. |
pkg/cli/logs_orchestrator_filters.go |
Carry requests into processed runs. |
pkg/cli/logs_models.go |
Add request reports and provenance. |
pkg/cli/logs_metrics.go |
Extract requests and distinguish unavailable evidence. |
pkg/cli/logs_format_tsv.go |
Render continuation summary totals. |
pkg/cli/logs_format_compact.go |
Render request details and availability totals. |
pkg/cli/logs_episode_retrieval_artifacts.go |
Collect and deduplicate episode requests. |
pkg/cli/logs_cached_json.go |
Backfill cached requests and audit counts. |
pkg/cli/health_revisions.go |
Apply continuation metrics to current health. |
pkg/cli/health_metrics.go |
Add continuation health reports. |
pkg/cli/health_durable.go |
Include requests in session-evidence rendering. |
pkg/cli/health_continuation_requests.go |
Summarize cached requests and unavailable runs. |
pkg/cli/drain3_integration.go |
Convert requests into analysis events. |
pkg/cli/continuation_requests.go |
Share counting, invalidation, merging, and rendering helpers. |
pkg/cli/authorization_verify.go |
Recognize queue authorization coverage. |
pkg/cli/audit.go |
Carry continuation analysis results. |
pkg/cli/audit_summary_build.go |
Include requests in audit summaries. |
pkg/cli/audit_run_pipeline.go |
Backfill requests and invalidate artifact markers. |
pkg/cli/audit_run_pipeline_detection_test.go |
Test cached agent-output lookup behavior. |
pkg/cli/audit_report.go |
Include requests in assembled audit data. |
pkg/cli/audit_report_types.go |
Add structured audit request reports. |
pkg/cli/audit_report_render.go |
Render requests and evidence availability. |
pkg/cli/audit_render_output.go |
Merge request evidence into audit caches. |
pkg/cli/audit_expanded.go |
Add session continuation request counts. |
pkg/cli/audit_cache.go |
Refresh cached audit request evidence. |
pkg/cli/audit_analysis_fanout.go |
Run continuation extraction alongside other analyses. |
docs/src/content/docs/reference/safe-outputs.md |
Document routes, limits, permissions, and analytics. |
docs/adr/79834-opt-in-request-continuation-signal.md |
Record the advisory signal’s original design. |
actions/setup/setup.sh |
Deploy continuation runtime modules to bundles. |
actions/setup/session_parsers.go |
Embed continuation runtime dependencies. |
actions/setup/md/safe_outputs_request_continuation_queue.md |
Explain queue handoffs and untrusted context. |
actions/setup/md/safe_outputs_request_continuation_dispatch.md |
Explain bounded dispatch handoffs. |
actions/setup/js/work_queue_scheduler.cjs |
Attach continuation context to assignments. |
actions/setup/js/work_queue_replay.cjs |
Enforce successor and approval replay rules. |
actions/setup/js/work_queue_replay_v4.test.cjs |
Test atomic successors and replay protection. |
actions/setup/js/work_queue_mcp_server.test.cjs |
Test successor context visibility. |
actions/setup/js/work_queue_mcp_server.cjs |
Expose continuation context beside payloads. |
actions/setup/js/work_queue_graph.test.cjs |
Test inheritance, budgets, and approval structure. |
actions/setup/js/work_queue_dispatch.test.cjs |
Test approval permission-read budgeting. |
actions/setup/js/work_queue_dispatch.cjs |
Refresh approvals and pair them with Claims. |
actions/setup/js/work_queue_dependency_resolver.test.cjs |
Test closer identity, roles, and approval states. |
actions/setup/js/work_queue_dependency_resolver.cjs |
Resolve writer-approved Issue dependencies. |
actions/setup/js/work_queue_control_adapter.cjs |
Expose scoped collaborator permission reads. |
actions/setup/js/work_queue_conformance_fixture_generator.cjs |
Generate continuation and approval fixtures. |
actions/setup/js/work_queue_conformance_checks.cjs |
Check continuation replay and checkpoints. |
actions/setup/js/work_queue_claim_scope.test.cjs |
Test assignment continuation validation. |
actions/setup/js/work_queue_claim_scope.cjs |
Validate continuation members in assignments. |
actions/setup/js/types/safe-outputs.d.ts |
Add the continuation item type. |
actions/setup/js/safeoutputs_cli.cjs |
Classify requests as non-terminal diagnostics. |
actions/setup/js/safe_outputs_tools.json |
Define the runtime continuation tool. |
actions/setup/js/safe_output_submission.test.cjs |
Test continuation dependency restrictions. |
actions/setup/js/safe_output_submission.cjs |
Reject request dependency participation. |
actions/setup/js/safe_output_manifest.cjs |
Exclude continuation requests from mutation manifests. |
actions/setup/js/request_continuation_handler.test.cjs |
Test advisory handling and route validation. |
actions/setup/js/request_continuation_handler.cjs |
Process advisory and routed requests. |
actions/setup/js/record_request_continuation.test.cjs |
Test timestamp recording without routing. |
actions/setup/js/record_request_continuation.cjs |
Record trusted request timestamps. |
actions/setup/js/pi_tool_policy.cjs |
Reserve continuation reporting for the parent agent. |
actions/setup/js/log_parser_shared.test.cjs |
Test request preview rendering. |
actions/setup/js/load_agent_output.cjs |
Classify requests as diagnostic output. |
actions/setup/js/handle_noop_message.test.cjs |
Test request-aware no-op classification. |
actions/setup/js/handle_noop_message.cjs |
Keep requests separate from task mutations. |
actions/setup/js/handle_agent_failure.test.cjs |
Test requests without completion evidence. |
actions/setup/js/handle_agent_failure.cjs |
Avoid treating request intent as completed work. |
actions/setup/js/finish_work_queue_claim.test.cjs |
Test successor ordering, receipts, and pending limits. |
actions/setup/js/create_prompt.cjs |
Render inbound continuation input as untrusted data. |
actions/setup/js/collect_ndjson_output.test.cjs |
Test timestamps and routed request rejection. |
actions/setup/js/collect_ndjson_output.cjs |
Validate routed requests and stamp timestamps. |
actions/setup/js/check_permissions_utils.cjs |
Extract reusable repository-role matching. |
actions/setup/js/bind_continuation_evidence.test.cjs |
Test digest binding and file rejection. |
actions/setup/js/bind_continuation_evidence.cjs |
Hash final output with run-attempt identity. |
.github/workflows/spec-extractor.md |
Enable advisory extraction follow-up requests. |
.github/workflows/pr-sous-chef.lock.yml |
Refresh shared validation registry only. |
.github/workflows/mattpocock-skills-reviewer.md |
Enable advisory review follow-up requests. |
.github/workflows/contribution-check.md |
Enable advisory evaluation follow-up requests. |
.changeset/minor-request-continuation-routes.md |
Describe routing and ledger compatibility requirements. |
Review effort: Max (adaptive)
Comment on lines
+27
to
+28
| // Do not echo potentially sensitive agent content into Actions logs. | ||
| core.info("request_continuation: follow-up requested; continuation not confirmed"); |
| if (canonical(operation) !== canonical(continuationChild(parent, continuation, approval))) throw invalid("a continuation must inherit exactly from its parent"); | ||
| // An automatic hop spends one unit of its parent's budget; a zero balance cannot hand off. | ||
| if (continuation.route === "workqueue" && parent.continuation && continuation.remaining >= parent.continuation.remaining) throw invalid("an automatic continuation must decrease its remaining budget"); | ||
| validateGraphAdmission(state, [operation]); |
| } | ||
|
|
||
| func processedRunFromSummary(summary *RunSummary, runOutputDir string) ProcessedRun { | ||
| backfillContinuationRequests(&summary.ContinuationRequests, summary.Run, runOutputDir, false) |
| if !ok || workQueueLogsMissing(params.includeWorkQueue, runOutputDir) { | ||
| return nil, false | ||
| } | ||
| if continuationEvidenceIdentityChanged(summary.Run, run) { |
| return { route, max_depth: maxDepth, aw_context: false }; | ||
| } | ||
| const file = descriptor.workflow_file; | ||
| if (typeof file !== "string" || !/^[A-Za-z0-9_.-]+\.(?:lock\.yml|yml)$/.test(file) || file.startsWith(".")) throw routeError("continuation_config_invalid", "dispatch requires a compiled local workflow_file"); |
| const { matchRepositoryRole, resolveRepositoryRole } = require("./check_permissions_utils.cjs"); | ||
|
|
||
| const COMMIT_SHA = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/; | ||
| const LOGIN = /^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$/; |
Comment on lines
+165
to
+167
| if (state.observations.get(key)?.state !== "ready" && !edges.has(key)) { | ||
| edges.set(key, edge); | ||
| if (edge.condition === "approved") approvals++; |
Comment on lines
+348
to
+353
| for _, artifact := range []string{constants.AgentArtifactName.String(), constants.AgentOutputFallbackArtifactName.String()} { | ||
| markerPath := filepath.Join(runOutputDir, downloadedArtifactsMarkerDir, artifact) | ||
| if err := os.Remove(markerPath); err != nil && !errors.Is(err, os.ErrNotExist) { | ||
| return fmt.Errorf("failed to invalidate %s download marker: %w", artifact, err) | ||
| } | ||
| } |
Comment on lines
+100
to
+102
| if auditData == nil || requests == nil { | ||
| return false | ||
| } |
Comment on lines
+132
to
+135
| if route == RequestContinuationRouteIssue { | ||
| workQueueRepoConfigLog.Printf("Worker %s uses issue-gated continuations; dispatcher reads approval Issues", worker) | ||
| data.SafeOutputs.workQueueApprovalReads = true | ||
| return nil |
…val issues or dispatch - Opt-in safe-outputs.request-continuation.route: workqueue (finish commit appends one successor Work), issue (successor gated on an approval issue closed as completed by a writer) or dispatch (named local workflow with a bounded gh_aw_continuation input). - continuation_evidence binds routed requests to the producing run attempt. - v4 ledger: optional Work continuation, finish-carried successor Work, Issue condition approved, Observation approved_by; JS/Go replay, TLA model and canonical fixtures. - Trusted finish step loads safe_output_authorization.cjs by non-literal path so the MCP and safe-outputs bundles never deploy a module that calls core.setSecret.
elefthei
force-pushed
the
work-queue-v4-timeless
branch
from
November 23, 2026 03:30
0810fb3 to
8cd94e7
Compare
elefthei
force-pushed
the
request-continuation-routes
branch
from
November 23, 2026 03:30
e9acf9b to
8433f57
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Stacked on #79748 (
work-queue-v4-timeless); review that one first. The queue route writes v4 ledger records that #79748 introduces.request_continuation(merged in #79834) is advisory: an agent can say more work remains, andaudit/logs/healthcount it, but nothing acts on it. This PR adds an opt-inrouteso a request can create exactly one follow-up, bounded by depth. Withoutroute, behavior is unchanged.work-queue-v4-timelessis now rebased ontomain, so this PR builds on #79834 directly instead of carrying a copy of it.Routes
workqueue(assignment-bound queue workers). The worker's finish commit appendsCompletionand one successor Work atomically. The successor depends on the parent, inherits its graph, pool, priority, fairness key, profile and payload, and gets the message asassignment.claims[i].continuation. Replay rejects a duplicate, pre-existing or unpaired successor (request_invalid).issue(queue workers). The publisher opens one approval issue in the queue repository. The successor carries an Issue dependency with the newapprovedcondition. It becomes ready only when aUserwith write, maintain or admin closes that issue as completed. Closes by bots, by triage-only users or as "not planned" don't approve. The ready Observation recordsapproved_byand is committed together with the Claim it releases.max-depthis rejected here; each approval releases one successor.dispatch(ordinary workflows).Process Safe Outputsdispatches the named local workflow on the default branch with agh_aw_continuationJSON input: version, message, remaining depth, source run. The remaining budget is the smaller of the localmax-depthand the inboundremaining. At zero the request is recorded and not dispatched. The receiver must declaregh_aw_continuationas a string input with no default. Self-targets, queue workers andworkflow_callworkflows are rejected at compile time.Routed forms accept only
max: 1. They use the globalsafe-outputs.authorization; queue admission isrequest_continuation:admit.Replay protection
A new agent-job output,
continuation_evidence, is<run_id>:<run_attempt>:<sha256 of agent_output.json>. It is computed just before the artifact upload.Process Safe Outputsand the worker finalizer check run attempt, digest and file bounds before routing, so a publisher-only rerun can't replay an earlier attempt's request.Ledger and compatibility
The v4 ledger gains an optional Work
continuation, finish commits that carry a successor Work, the Issue conditionapproved, and Observationapproved_by. JS and Go replay apply the same inheritance, depth, size and approval rules.WorkQueueV4.tla::Completenow allows one previously absent successor.specs/work-queue/fixtures/canonical-prefix.jsonadds accepted and rejected continuation, approval and checkpoint cases. Existing ledgers replay unchanged.Older v4 readers reject a finish commit that carries Work. Upgrade workers, dispatchers, maintenance and the CLI before turning on a queue route against a shared ledger.
Worth a careful look
work_queue_dependency_resolver.cjs::approvalPredicatechecks the closer's role when the dispatcher plans, not when the issue was closed. Thereadyobservation is committed in the samedispatch_nextcommit that claims the successor. A writer who closes the issue and loses access before the next dispatcher run does not approve it.finish_work_queue_claim.cjsalso ships in the MCP and safe-outputs bundles (throughwork_queue_claim_scope.cjs).safe_output_authorization.cjscallscore.setSecret, which would corrupt an MCP server's stdout. Sowork_queue_continuation.cjs::authorizationProtocolloads it by a non-literal path, and only in the trusted finish step.setup.shdeploys the continuation modules andcheck_permissions_utils.cjsto both bundles, but not the authorization module.pr-sous-chef.lock.ymlchanges only because the shared validation registry now listsrequest_continuation; that workflow doesn't enable it.Validation
make fmtandmake recompile(370 workflows) change nothing.npm run typecheckinactions/setup/js: 0 errors.make agent-report-progress(BASE_REF=origin/main) on the rebased stack (8433f57, merged as 0414cf3 with an identical tree): every check passes, including custom Go linters and impacted JS tests (72 files / 2096 tests).pkg/clianalytics and the logs/audit schemas now come frommainunchanged, so the earlier 38 custom-linter findings in copied code are gone.